<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
	language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="webctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>公共投诉基本信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<meta name="GENERATOR"
	content="Rational® Application Developer™ for WebSphere® Software">
<link rel="stylesheet" href="${webctx }/js/ext/resources/css/ext-all.css"
	type="text/css">
	<link rel="stylesheet" href="${webctx }/js/ext/resources/css/xtheme-gray.css" type="text/css">
<script language="JavaScript" src="${webctx }/js/ext/adapter/ext/ext-base.js"></script>
<script language="JavaScript" src="${webctx }/js/ext/js/ext-all.js"></script>
<script language="JavaScript"
	src="${webctx }/js/ext/resources/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
<script type="text/javascript" src="${webctx }/js/extInterceptor.js"></script>
<link rel="stylesheet" href="${webctx }/images/dcfs/dcfs.css" type="text/css">
</head>
<body>
<div style="border: #ccc 1px solid; width: 100%;
    height: 100%; " id="dituContent">
</div>
<script type="text/javascript">
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget='side';
var map = new BMap.Map("dituContent");
map.enableDragging();
map.enableScrollWheelZoom();
map.enableDoubleClickZoom();
map.enableKeyboard();
var ctrl_nav = new BMap.NavigationControl({
    anchor: BMAP_ANCHOR_TOP_LEFT,
    type: BMAP_NAVIGATION_CONTROL_LARGE
});
map.addControl(ctrl_nav);
var ctrl_sca = new BMap.ScaleControl({
    anchor: BMAP_ANCHOR_BOTTOM_LEFT
});
map.addControl(ctrl_sca);
var marker=null;
	
var SB_JBXX_window = new Ext.Window({
	id: "SB_JBXX_window",
	layout:"fit",
	resizable: false,
	collapsible: false,
	closeAction: "hide",
	action: 'add',
	listeners: {
		hide: function (w) {
			Ext.getCmp("sb_tab").setActiveTab(0);
		}
	},
	items:[
		{
			xtype:"tabpanel",
			id:"sb_tab",
			activeTab:0,
			items:[
			{
				title:'基本信息',
				xtype:"form",
				id:"dcfs_jz_sb_form",
				bodyStyle:'padding:15px 5px 0px 10px',
				defaultType:"displayfield",
				defaults:{anchor:'92%',border:false},
				items:[
					{
						fieldLabel:"设备编号",
						name:"JZ_SB_BH",
						id:"JZ_SB_BH"
					},{
						fieldLabel:"设备名称",
						name:"JZ_SB_MC",
						id:"JZ_SB_MC"
					},{
						 fieldLabel: "设备安装地理位置",
						 name:"JZ_SB_AZWZ",
						 id:"JZ_SB_AZWZ"
					},{
						fieldLabel: "启用时间",
						name:"JZ_SB_QYSJ",
						id:"JZ_SB_QYSJ"
					}, {
						fieldLabel:"运营商信息",
						name:"JZ_YYS_XX",
						id:"JZ_YYS_XX"
					},{
						fieldLabel:"基站环评状态",
						name:"JZ_HP_ZT",
						id:"JZ_HP_ZT"
					}, {
						fieldLabel: "天线架设方式 ",
						name:"JZ_FSTX_JSFS",
						id:"JZ_FSTX_JSFS"
					}, {
						fieldLabel:"环评检测单位",
						name:"JZ_JC_DW",
						id:"JZ_JC_DW"
					},{
						fieldLabel:"环评批复单位",
						name:"JZ_YS_DW",
						id:"JZ_YS_DW"
					}, {
						fieldLabel: "敏感点信息描述",
						name:"JZ_BZ",
						id:"JZ_BZ"
					}
				]
			}, {
				title:'详细信息',
				items:[
					{
					xtype:"form",

					border:false,
					defaults:{border:false,labelWidth:100},
					items:[
						{
							layout:"column",
							defaults:{columnWidth:.5,labelWidth:100,border:false},
							items:[

								{
									layout:"form",
									bodyStyle:'padding:15px 5px 0px 10px',
									defaultType:"displayfield",
									defaults:{anchor:'92%',border:false},
									items:[
										{
											fieldLabel:"设备型号",
											name:"JZ_SB_XH",
											id:"JZ_SB_XH"
										}, {
											fieldLabel: "网络类型",
											name:"JZ_SB_WLLX",
											id:"JZ_SB_WLLX"
										}, {
											fieldLabel:"主要用途",
											name:"YT_MC",
											id:"YT_MC"
										}, {
											fieldLabel: "标称功率(W)",
											name:"JZ_BCGL",
											id:"JZ_BCGL"
										},{
											 fieldLabel: "下行频段1(MHz)",
											 name:"JZ_XXPD_1",
											 id:"JZ_XXPD_1"
										},{
											fieldLabel: "下行频段2(MHz)",
											name:"JZ_XXPD_2",
											id:"JZ_XXPD_2"
										}, {
											fieldLabel:"天线极化方式",
											name:"JZ_FSTX_JHFS",
											id:"JZ_FSTX_JHFS"
										}, {
											fieldLabel: "天线方位角(度)",
											name:"JZ_FSTX_FWJ",
											id:"JZ_FSTX_FWJ"
										}, {
											fieldLabel: "天线下频角(度)",
											name:"JZ_FSTX_XPJ",
											id:"JZ_FSTX_XPJ"
										},{
											  fieldLabel: "纬度",
											  name:"JZ_FSTX_WD",
											  id:"JZ_FSTX_WD"
										},{
												fieldLabel: "百度纬度",
											  name:"BD_WD",
											  id:"BD_WD"
										}
									]
								},
								{
									layout:"form",
									defaultType:"displayfield",
									bodyStyle:'padding:15px 5px 0px 20px',
									defaults:{anchor:'92%',labelWidth:100,border:false},
									items:[
										{
											fieldLabel: "载频配置",
											name:"JZ_ZPPZ",
											id:"JZ_ZPPZ"
										},{
											 fieldLabel: "基站编号",
											 name:"JZ_BH",
											 id:"JZ_BH"
										},{
											fieldLabel: "天线增益",
											 name:"JZ_TXZY",
											id:"JZ_TXZY"
										}, {
											 fieldLabel: "发射天线类型",
											 name:"JZ_FSTX_LX",
											 id:"JZ_FSTX_LX"
										},{
											 fieldLabel: "架设高度(m)",
											 name:"JZ_FSTX_JSGD",
											 id:"JZ_FSTX_JSGD"
										}, {

											fieldLabel: "数量",
											 name:"JZ_FSTX_SL",
											 id:"JZ_FSTX_SL"
										}, {
											 fieldLabel: "基站名称",
											 name:"JZ_MC",
											 id:"JZ_MC"
										},{
											  fieldLabel: "设备区域",
											  name:"JZ_SB_QY",
											  id:"JZ_SB_QY"
										},{
												 fieldLabel: "百度经度",
											  name:"BD_JD",
											  id:"BD_JD"
										}, {
											  fieldLabel: "经度",
											  name:"JZ_FSTX_JD",
											  id:"JZ_FSTX_JD"
										}, {
											  fieldLabel: "地点",
											  name:"JZ_DD",
											  id:"JZ_DD"
										}
									]
								}
							]
						}
					]
				}
			]
		},{
			title:"地图",
			border:false,
			contentEl:'dituContent'
		}
	]
		}
	]
   
});

var Win=new Ext.Window({
	id: "Win",
	layout: "fit",
	resizable: false,
	collapsible: false,
	closeAction: "hide",
	modal: true,
	autoDestroy: true,
	action:'add',
	items:[
	{
	  xtype:"form",
	  id:"ggts_Form",
	  border: false,
	  frame:false,
	  defaultType:"textfield",
	  bodyStyle:'padding:10px 5px 0 13px',
	  defaults:{anchor: "93%",border:false, blankText: "不能为空" },
	  items:[
		 {  xtype:'hidden',
			fieldLabel: "投诉编号",
			name:"dcfsGgtsJbxx.tsbh",
			id: "TS_BH"
		 },{
			   xtype:"datefield",
			   fieldLabel: "投诉时间",
			   name:"dcfsGgtsJbxx.tssj",
			   editable: false,
			   id: "TS_SJ",
			   format: 'Y-m-d H:i:s',
			   value:new Date()
		 },{
			fieldLabel: "投诉人",
			name:"dcfsGgtsJbxx.tsr",
			id: "TS_R",
			validator: function () {
				  if (this.getValue().trim().length == 0) {
					  return "投诉人不能为空";
				  }
				  else {
					  return true;
				  }
			  }
		 },{
			fieldLabel: "投诉地点",
			name:"dcfsGgtsJbxx.tsdd",
			id: "TS_DD",
			validator: function () {
				  if (this.getValue().trim().length == 0) {
					  return "投诉地点不能为空";
				  }
				  else {
					  return true;
				  }
			  }

		 },{
			fieldLabel: "投诉人联系电话",
			name:"dcfsGgtsJbxx.tsrlxdh",
			id: "TS_R_LXDH",
			validator: function () {
				  if (this.getValue().trim().length == 0) {
					  return "投诉人不能为空";
				  }
				  else {
					  return true;
				  }
			  }

		 },{
			xtype:"combo",
			fieldLabel: "设备所属区域",
			name:"dcfsGgtsJbxx.tssbssqy",
			id: "TS_SB_SSQY",
			editable: false,
				 triggerAction: 'all',
				 store: new Ext.data.SimpleStore({
				 fields:[{name:"TS_SB_SSQY"},{name:"TS_SB_SSQY"}],
					  data: [
						['江岸区',"江岸区"],
						['桥口区',"桥口区"],
								['汉阳区',"汉阳区"],
								['武昌区',"武昌区"],
								['洪山区',"洪山区"],
								['青山区',"青山区"],
								['东西湖区',"东西湖区"],
								['水果湖区',"水果湖区"],
								['江夏区',"江夏区"],
								['蔡甸区',"蔡甸区"],
								['江汉区',"江汉区"],
								['汉南区',"汉南区"],
								['黄陂区',"黄陂区"],
								['新洲区',"新洲区"],
								['东湖高新区', "东湖高新区"]

					 ]
				}),
				mode:'local',
				valueField:'TS_SB_SSQY',
				displayField:'TS_SB_SSQY',
				selectOnFocus:true,
				validator: function () {
					  if (this.getValue().trim().length == 0) {
						  return "设备所属区域不能为空";
					  }
					  else {
						  return true;
					  }
				  },
				listeners:{
								"select":function(){
									var sb_qy=Ext.getCmp("TS_SB_SSQY").getValue();

									if(Ext.getCmp("TS_SB_MC").getStore()!=""){
										Ext.getCmp("TS_SB_MC").reset();
										Ext.getCmp("TS_SB_MC").getStore().removeAll();
										Ext.getCmp("TS_SB_MC").getStore().load({params:{'dcfsJzSbJbxx.jzsbqy':sb_qy}});
									}else{
										//Ext.getCmp("TS_SB_MC").getStore().load({params:{SB_QY:sb_qy}});
									}

								}
							}
		 },{xtype: 'compositefield',
			fieldLabel: '设备名称',
			labelWidth: 120,
			items: [
				{
				   xtype:"combo",
				   name:"dcfsGgtsJbxx.tssbmc",
				   id:"TS_SB_MC",
				   flex:0.3,
				   editable: false,
				   triggerAction:'all',
				   store:{
						xtype:"jsonstore",
						url:"${webctx}/tsjzsb_getDcfsJzSbJbxxqy.action",
						root:"SB",
						fields: [{ name:"SB_BH" }, { name:"SB_MC" }]
				   },
				   mode:'local',
				   valueField: 'SB_BH',
				   displayField:'SB_MC',
				   selectOnFocus:true,
				   listeners:{
						"select":function(){
							Ext.getCmp("TS_SB_BH").setValue(Ext.getCmp("TS_SB_MC").getValue());
							//alert(Ext.getCmp("get_SB_BH").getValue())
						}
				   },
				   validator: function () {
					  if (this.getValue().trim().length == 0) {
						  return "设备名称不能为空";
					  }
					  else {
						  return true;
					  }
				  }

				},
				{
					xtype: 'button',
					text:"详情",
					flex : 0.1,
					handler:function(){
						if(Ext.getCmp("TS_SB_MC").getValue()!=""){
							if(Ext.getCmp("Win").action=="add"){
								Ext.getCmp("TS_SB_BH").setValue(Ext.getCmp("TS_SB_MC").getValue());
								var SB_BH=Ext.getCmp("TS_SB_BH").getValue();
								Ext.Msg.wait('数据加载中，请稍后...', '提示');
								//Ext.getCmp('SB_JBXX_window').load({url:"Load_DCFS_GGTS_SB_Servlet",params:{SB_BH:SB_BH,loaditem:"add"}});
								var extAjax = Ext.Ajax;
								extAjax.request({
									url:"${webctx }/gis_getJzsbJbxx.action",
									method: 'POST',
									params:{'dcfsJzSbJbxx.jzsbbh':SB_BH},
									callback: function (object, bool, response) {
									   Ext.Msg.hide();
									   Ext.getCmp("SB_JBXX_window").setSize(600,380);
									   Ext.getCmp('SB_JBXX_window').show();
									   Ext.getCmp('SB_JBXX_window').action='add';
									   Ext.getCmp('SB_JBXX_window').center();
									   Ext.getCmp("JZ_SB_BH").setValue(response.responseText.split(":'")[1].split("',")[0]);
									   Ext.getCmp("JZ_SB_MC").setValue(response.responseText.split(":'")[2].split("',")[0]);
									   Ext.getCmp("JZ_SB_XH").setValue(response.responseText.split(":'")[3].split("',")[0]);
									   Ext.getCmp("JZ_SB_WLLX").setValue(response.responseText.split(":'")[4].split("',")[0]);
									   Ext.getCmp("YT_MC").setValue(response.responseText.split(":'")[5].split("',")[0]);
									   Ext.getCmp("JZ_SB_AZWZ").setValue(response.responseText.split(":'")[7].split("',")[0]);
									   Ext.getCmp("JZ_SB_QYSJ").setValue(response.responseText.split(":'")[8].split("',")[0]);
									   Ext.getCmp("JZ_BCGL").setValue(response.responseText.split(":'")[9].split("',")[0]);
									   Ext.getCmp("JZ_ZPPZ").setValue(response.responseText.split(":'")[10].split("',")[0]);
									   Ext.getCmp("JZ_XXPD_1").setValue(response.responseText.split(":'")[11].split("',")[0]);
									   Ext.getCmp("JZ_XXPD_2").setValue(response.responseText.split(":'")[12].split("',")[0]);
									   Ext.getCmp("JZ_TXZY").setValue(response.responseText.split(":'")[13].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_LX").setValue(response.responseText.split(":'")[14].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JHFS").setValue(response.responseText.split(":'")[15].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_FWJ").setValue(response.responseText.split(":'")[16].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_XPJ").setValue(response.responseText.split(":'")[17].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JD").setValue(response.responseText.split(":'")[18].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_WD").setValue(response.responseText.split(":'")[19].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JSFS").setValue(response.responseText.split(":'")[20].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JSGD").setValue(response.responseText.split(":'")[21].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_SL").setValue(response.responseText.split(":'")[22].split("',")[0]);
									   Ext.getCmp("JZ_BZ").setValue(response.responseText.split(":'")[23].split("',")[0]);
									   Ext.getCmp("JZ_BH").setValue(response.responseText.split(":'")[24].split("',")[0]);
									   Ext.getCmp("JZ_MC").setValue(response.responseText.split(":'")[25].split("',")[0]);
									   Ext.getCmp("JZ_DD").setValue(response.responseText.split(":'")[26].split("',")[0]);
									   Ext.getCmp("BD_JD").setValue(response.responseText.split(":'")[27].split("',")[0]);
									   Ext.getCmp("BD_WD").setValue(response.responseText.split(":'")[28].split("',")[0]);
									   Ext.getCmp("JZ_HP_ZT").setValue(response.responseText.split(":'")[29].split("',")[0]);
									   Ext.getCmp("JZ_YS_DW").setValue(response.responseText.split(":'")[30].split("',")[0]);
									   Ext.getCmp("JZ_YYS_XX").setValue(response.responseText.split(":'")[31].split("',")[0]);
									   Ext.getCmp("JZ_JC_DW").setValue(response.responseText.split(":'")[32].split("',")[0]);
									   Ext.getCmp("JZ_SB_QY").setValue(response.responseText.split(":'")[33].split("'")[0]);
									   //百度坐标

									   window.setTimeout(function(){
										 if(marker!=null){
											map.removeOverlay(marker);
										 }
										 var point = new BMap.Point(Ext.getCmp("BD_JD").getValue(), Ext.getCmp("BD_WD").getValue());
										 map.centerAndZoom(point, 18);
										 marker = new BMap.Marker(point);
										 map.addOverlay(marker);
									   },1500);
									},
									failure: function (response) {
										Ext.Msg.alert("提示", "操作出现了异常！");
									}

								});

							}else if(Ext.getCmp("Win").action=="update"){
								//Ext.getCmp("get_SB_BH").setValue(Ext.getCmp("TS_SB_MC").getValue());
								var SB_BH=Ext.getCmp("TS_SB_BH").getValue();

								Ext.Msg.wait('数据加载中，请稍后...', '提示');
								//Ext.getCmp('SB_JBXX_window').load({url:"Load_DCFS_GGTS_SB_Servlet",params:{SB_BH:SB_BH,loaditem:"add"}});
								var extAjax = Ext.Ajax;
								extAjax.request({
									url:"${webctx }/gis_getJzsbJbxx.action",
									method: 'POST',
									params:{'dcfsJzSbJbxx.jzsbbh':SB_BH},
									callback: function (object, bool, response) {
									   Ext.Msg.hide();
									   Ext.getCmp("SB_JBXX_window").setSize(600,380);
									   Ext.getCmp('SB_JBXX_window').show();
									   Ext.getCmp('SB_JBXX_window').action='add';
									   Ext.getCmp('SB_JBXX_window').center();
									   Ext.getCmp("JZ_SB_BH").setValue(response.responseText.split(":'")[1].split("',")[0]);
									   Ext.getCmp("JZ_SB_MC").setValue(response.responseText.split(":'")[2].split("',")[0]);
									   Ext.getCmp("JZ_SB_XH").setValue(response.responseText.split(":'")[3].split("',")[0]);
									   Ext.getCmp("JZ_SB_WLLX").setValue(response.responseText.split(":'")[4].split("',")[0]);
									   Ext.getCmp("YT_MC").setValue(response.responseText.split(":'")[5].split("',")[0]);
									   Ext.getCmp("JZ_SB_AZWZ").setValue(response.responseText.split(":'")[7].split("',")[0]);
									   Ext.getCmp("JZ_SB_QYSJ").setValue(response.responseText.split(":'")[8].split("',")[0]);
									   Ext.getCmp("JZ_BCGL").setValue(response.responseText.split(":'")[9].split("',")[0]);
									   Ext.getCmp("JZ_ZPPZ").setValue(response.responseText.split(":'")[10].split("',")[0]);
									   Ext.getCmp("JZ_XXPD_1").setValue(response.responseText.split(":'")[11].split("',")[0]);
									   Ext.getCmp("JZ_XXPD_2").setValue(response.responseText.split(":'")[12].split("',")[0]);
									   Ext.getCmp("JZ_TXZY").setValue(response.responseText.split(":'")[13].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_LX").setValue(response.responseText.split(":'")[14].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JHFS").setValue(response.responseText.split(":'")[15].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_FWJ").setValue(response.responseText.split(":'")[16].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_XPJ").setValue(response.responseText.split(":'")[17].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JD").setValue(response.responseText.split(":'")[18].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_WD").setValue(response.responseText.split(":'")[19].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JSFS").setValue(response.responseText.split(":'")[20].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_JSGD").setValue(response.responseText.split(":'")[21].split("',")[0]);
									   Ext.getCmp("JZ_FSTX_SL").setValue(response.responseText.split(":'")[22].split("',")[0]);
									   Ext.getCmp("JZ_BZ").setValue(response.responseText.split(":'")[23].split("',")[0]);
									   Ext.getCmp("JZ_BH").setValue(response.responseText.split(":'")[24].split("',")[0]);
									   Ext.getCmp("JZ_MC").setValue(response.responseText.split(":'")[25].split("',")[0]);
									   Ext.getCmp("JZ_DD").setValue(response.responseText.split(":'")[26].split("',")[0]);
									   Ext.getCmp("BD_JD").setValue(response.responseText.split(":'")[27].split("',")[0]);
									   Ext.getCmp("BD_WD").setValue(response.responseText.split(":'")[28].split("',")[0]);
									   Ext.getCmp("JZ_HP_ZT").setValue(response.responseText.split(":'")[29].split("',")[0]);
									   Ext.getCmp("JZ_YS_DW").setValue(response.responseText.split(":'")[30].split("',")[0]);
									   Ext.getCmp("JZ_YYS_XX").setValue(response.responseText.split(":'")[31].split("',")[0]);
									   Ext.getCmp("JZ_JC_DW").setValue(response.responseText.split(":'")[32].split("',")[0]);
									   Ext.getCmp("JZ_SB_QY").setValue(response.responseText.split(":'")[33].split("'")[0]);
									   //百度坐标

									   window.setTimeout(function(){
										 if(marker!=null){
											map.removeOverlay(marker);
										 }
										 var point = new BMap.Point(Ext.getCmp("BD_JD").getValue(), Ext.getCmp("BD_WD").getValue());
										 map.centerAndZoom(point, 18);
										 marker = new BMap.Marker(point);
										 map.addOverlay(marker);
									   },1500);
									},
									failure: function (response) {
										Ext.Msg.alert("提示", "操作出现了异常！");
									}

								});
							}
						}else{
							Ext.Msg.alert("提示", "请选中一个基站");
						}
					 }
				}
			]

			} ,{
			   xtype:"textarea",
			  fieldLabel: "投诉情况描述",
			  name:"dcfsGgtsJbxx.tsqkms",
			  id: "TS_QKMS"

		 },{
			xtype:"hidden",
			fieldLabel: "备注",
			name:"dcfsGgtsJbxx.tsbz",
			id: "TS_BZ"


		 },{
			  xtype:"hidden",
			 fieldLabel: "状态",
			 name:"dcfsGgtsJbxx.tszt",
			 id: "TS_ZT"
		 },{
			  xtype:"hidden",
			 name:"dcfsGgtsJbxx.tssblx",
			 id: "TS_SB_LX"
		 },{

			xtype:"hidden",
			id:"get_TS",
			name:"get_TS_value"

		 },{
			xtype:"hidden",
			id:"TS_SB_BH",
			name:"dcfsGgtsJbxx.tssbbh"
		}

	   ]

	}

	],
	buttons:[
	 {
	   text:"添加",
	   id:"submit_btn",
	   handler:function(){
			if(Ext.getCmp("Win").action=="add")
				   {
					   var datee=new Date();
					   var month= datee.getMonth()+1;
					   if(month<10){
							month=0+''+month;
					   }
					   var day=datee.getDate();
					   if(day<10){
							day=0+''+day;
					   }
					   var hour=datee.getHours();
					   if(hour<10){
							hour=0+''+hour;
					   }
					   var fz=datee.getMinutes();
					   if(fz<10){
							fz=0+''+fz;
					   }
					   var mm=datee.getSeconds();
					   if(mm<10){
						mm=0+''+mm;
					   }
					  // alert(datee.getFullYear()+''+month+''+day+''+hour+''+fz+''+mm);
					   Ext.getCmp("TS_BH").setValue(datee.getFullYear()+''+month+''+day+''+hour+''+fz+''+mm);
					   Ext.getCmp("TS_SB_LX").setValue("基站设备");
					   Ext.getCmp("TS_ZT").setValue("未处理");
					   Ext.getCmp("get_TS").setValue(Ext.getCmp("TS_SB_MC").getValue());
					   Ext.getCmp("TS_SB_MC").getStore().removeAll();
					   Ext.getCmp("ggts_Form").getForm().submit({
						   waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
						  method:"POST",
						  url:"${webctx}/ggts_insertDcfsGgtsJbxx.action",
						  params:{action:"1"},
						  success:function(form,Retaction){
							  Ext.Msg.hide();
							  Ext.getCmp("ggts_Form").getForm().reset();
							   Ext.getCmp("ggts_grid").getStore().load();
						  },
						  failure:function(form,Retaction){
							   Ext.Msg.alert("提示","操作出现了异常！");
						  }
					   });

				  }
				if(Ext.getCmp("Win").action=="update")
				  {
					 // Ext.getCmp("get_SB_BH").setValue(Ext.getCmp("TS_SB_MC").getValue())
					  Ext.getCmp("TS_SB_MC").getStore().removeAll();
						Ext.getCmp("ggts_Form").getForm().submit({
							waitMsg : '正在提交表单数据,请稍候...',
							waitTitle : '正在验证数据...',
						   method:"POST",
						   url:"${webctx}/ggts_updateDcfsGgtsJbxx.action",
						   params:{action:"2"},
						   success:function(form,Retaction){
							   Ext.Msg.hide();
							 Ext.getCmp("ggts_grid").getStore().load();
							   Ext.getCmp("Win").hide();
							   Ext.getCmp("ggts_Form").getForm().reset();
						   },
						   failure:function(form,Retaction){
							   Ext.Msg.alert("提示","操作出现了异常！");
						   }
					   });

				  }

			}

	 },{
		   text:"取消",
		   handler:function(){
			 Ext.getCmp("Win").hide();
			 Ext.getCmp("ggts_Form").getForm().reset();
		   }

	  }

	],
	listeners:{
		'hide':function(){
			Ext.getCmp("ggts_Form").getForm().reset();
		}
	}
});

function tscl(sj,bh){
   window.location.href="Load_DCFS_TSCL_JBXX_Servlet?id="+sj+"&sb="+bh+"";
}

var sm = new Ext.grid.CheckboxSelectionModel();
Ext.onReady(function(){    
	var viewport = new Ext.Viewport({
	  layout:'Fit',
	  items:[
		{
		  xtype:"grid",
		  title:"投诉记录",
		  id:'ggts_grid',
		  border: false,
			 frame: false,
			 //iconCls:"sxly",
			 loadMask:true,
			 viewConfig:{ forceFit: true },
			 sm:sm,
			 store: {
				  xtype:"jsonstore",
				  url:"${webctx}/ggts_getDcfsTsclJbxxListByCond.action",
				  root:"root",
				  fields: [
					{name:"TS_BH"},{name:"TS_SJ"},{name:"TS_R"},{name:"TS_DD"},
					   {name:"TS_R_LXDH"},{name:"TS_SB_SSQY"},{name:"TS_SB_LX"},{name:"TS_SB_MC"},
					   {name:"TS_SB_BH"},{name:"TS_QKMS"},{name:"TS_BZ"},{name:"TS_ZT"}
					]
			 },
			 columns:[
				  sm,
				   {header:"投诉编号",dataIndex:"TS_BH",sortable:true},
				   {header:"投诉时间",dataIndex:"TS_SJ",sortable:true},
				   {header:"投诉人",dataIndex:"TS_R"},
				   {header:"投诉地点",dataIndex:"TS_DD"},
				   {header:"投诉人联系电话",dataIndex:"TS_R_LXDH"},
				   {header:"设备所属区域",dataIndex:"TS_SB_SSQY"},
				   {header:"设备类型",dataIndex:"TS_SB_LX"},
				   {header:"设备名称",dataIndex:"TS_SB_MC"},
				   {header:"设备编号",dataIndex:"TS_SB_BH"},
				   {header:"投诉情况描述",dataIndex:"TS_QKMS"},
				   //{header:"备注",dataIndex:"TS_BZ"},
				   {header:"状态",dataIndex:"TS_ZT"},
				   {header:"操作",dataIndex:"TS_BH",
					  renderer:function(value,g,content){

							  return "<a href='${webctx }/dcfs_ggts/dcfs_ggts_cl_jbxx.jsp?id="+ content.get("TS_BH")+"&sb="+ content.get("TS_SB_BH")+"'>详细信息</a>";
							//return    "<input type='button' icon='' value='处理' onclick='tscl(\""+ content.get("TS_BH")+"\",\""+ content.get("TS_SB_BH")+"\")'/>";

					  }
				   }
			],
			tbar :[
				"->",
				{
					 text:"录入",
					 iconCls: "icon-add",
					 handler:function(){
						Ext.getCmp("Win").setSize(800,350);
							  Ext.getCmp('Win').show();
							  Ext.getCmp('Win').action='add';
							  Ext.getCmp('Win').center();

							  if(Ext.getCmp('Win').changeValue!='-1'||Ext.getCmp("ggts_Form"))
							  {
								  Ext.getCmp('Win').setTitle("添加设备申报登记信息");
								  Ext.getCmp("submit_btn").setText('添加');
							  }
							  if(!Ext.getCmp("ggts_Form"))
							  {
								  if(Ext.getCmp('Win').changeValue == '-1')
								  {
									  Ext.getCmp('Win').removeAll();
								  }
								  Ext.getCmp('Win').load({url:'${webctx}/ggts_getDcfsTsclJbxxListByCond.action',scripts:true,params:{loaditem:"add"}});
								  Ext.getCmp('Win').changeValue = '1';
							  }

					 }

				},'-',{
					 text:"删除",
					 iconCls: "icon-delete",
					 handler:function(){
						 if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() > 0) {
									Ext.MessageBox.confirm('提示', '数据删除后不可还原,是否删除?', function (btn) {
										if (btn != "no") {
											var sbytList = "";
											for (var i = 0; i < Ext.getCmp("ggts_grid").getSelectionModel().getSelections().length; i++) {
												 var extAjax = Ext.Ajax;
												 Ext.Msg.wait("提示","正在删除",{text:"正在删除数据..."});
												extAjax.request({
													url:"${webctx}/ggts_deleteDcfsGgtsJbxxByCond.action",
													method: 'POST',
													params:{action:"3",'dcfsGgtsJbxx.tsbh':Ext.getCmp("ggts_grid").getSelectionModel().getSelections()[i].get("TS_BH")},
													callback: function (object, bool, response) {
														Ext.Msg.hide();
														Ext.getCmp("ggts_grid").getStore().load({ params:{ start: 0, limit: 30} } );
													},
													failure: function (response) {
														Ext.Msg.alert("提示", "操作出现了异常！");
													}

												});
											}
										}
									});
								}
								else if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() == 0) {
									Ext.Msg.alert("提示", "请最少选择一条记录");
								}

					 }

				  },'-',{
					 text:"修改",
					 iconCls: "icon-update",
					 handler:function(){
						  if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() == 1) {
									var recordNum = -1;
									for (var i = 0; i < Ext.getCmp("ggts_grid").getStore().getCount(); i++) {
										if (Ext.getCmp("ggts_grid").getSelectionModel().getSelected(0).get("TS_BH") == Ext.getCmp("ggts_grid").getStore().getAt(i).get("TS_BH")) {
											recordNum = i;
											break;
										}
									}
									Ext.getCmp("Win").setSize(800,350);
									Ext.getCmp('Win').show();
									Ext.getCmp('Win').action='update';
									Ext.getCmp('Win').recordNum=recordNum;
									Ext.getCmp('Win').center();

									if(Ext.getCmp('Win').changeValue!='-1'||Ext.getCmp("ggts_Form"))
									{
										Ext.getCmp('Win').setTitle("公共投诉信息");
										Ext.getCmp("submit_btn").setText('保存');

										Ext.getCmp("ggts_Form").getForm().loadRecord(Ext.getCmp("ggts_grid").getStore().getAt(recordNum));


										   Ext.getCmp("TS_SJ").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SJ").split(' ')[0]);
									 /*Ext.getCmp("TS_BH").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_BH"));


										   Ext.getCmp("TS_R").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_R"));
										   Ext.getCmp("TS_DD").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_DD"));
										   Ext.getCmp("TS_R_LXDH").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_R_LXDH"));
										   Ext.getCmp("TS_SB_SSQY").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SB_SSQY"));

										   Ext.getCmp("TS_SB_MC").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SB_MC"));
										   Ext.getCmp("TS_QKMS").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_QKMS"));
										   Ext.getCmp("TS_BZ").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_BZ"));
											Ext.getCmp("TS_ZT").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_ZT"));*/

									}


									if(!Ext.getCmp("ggts_Form"))
									{
										if(Ext.getCmp('Win').changeValue == '-1')
										{
											Ext.getCmp('Win').removeAll();
										}
										Ext.getCmp('Win').load({url:'DCFS_GGTS_JBXX_Servlet',scripts:true,params:{loaditem:"add"}});
										Ext.getCmp('Win').changeValue = '1';
									}
							  }
							  else if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() == 0) {
									Ext.Msg.alert("提示", "请最少选择一条记录");
							  }
							  else {
									Ext.Msg.alert("提示", "只能选择一条数据进行编辑");
							  }

					 }

				  },{
					 text:"处理",
					 iconCls: "icon-handle",
					 handler:function(){
							if (Ext.getCmp("ggts_grid").getSelectionModel().getCount()>0) {
								 Ext.MessageBox.confirm('提示', '数据是否处理？', function (btn) {
									if (btn != "no") {
											var sbytList = "";
											for (var i = 0; i < Ext.getCmp("ggts_grid").getSelectionModel().getSelections().length; i++) {
												if(Ext.getCmp("ggts_grid").getSelectionModel().getSelections()[i].get("TS_ZT")=="已处理"){
													Ext.Msg.alert("提示", "该记录已处理");
													return;

												}else{
													  Ext.Msg.wait('处理中，请稍后...', '提示');
													 var extAjax = Ext.Ajax;
													 Ext.getCmp("TS_ZT").setValue("已处理");
													 extAjax.request({
														 url:"${webctx}/ggts_updateDcfsGgtsJbxx_tscl.action",
														 method: 'POST',
														 params:{'dcfsGgtsJbxx.tszt': Ext.getCmp("TS_ZT").getValue(),'dcfsGgtsJbxx.tsbh':Ext.getCmp("ggts_grid").getSelectionModel().getSelections()[i].get("TS_BH")},
														 callback: function (object, bool, response) {
															Ext.Msg.hide();
															Ext.getCmp("ggts_grid").getStore().load({ params:{ start: 0, limit: 30} } );
														 },
														 failure: function (response) {
															Ext.Msg.alert("提示", "操作出现了异常！");
														 }

												   });
												}

											}


									}
								   });

							  }
							  else if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() == 0) {
									Ext.Msg.alert("提示", "请最少选择一条记录");
							  }

					}

				  },{
					 text:"发布",
					 iconCls:"icon-release",
					 handler:function(){
							if (Ext.getCmp("ggts_grid").getSelectionModel().getCount()>0) {
								 Ext.MessageBox.confirm('提示', '数据是否发布？', function (btn) {
									if (btn != "no") {
											var sbytList = "";
											for (var i = 0; i < Ext.getCmp("ggts_grid").getSelectionModel().getSelections().length; i++) {
												if(Ext.getCmp("ggts_grid").getSelectionModel().getSelections()[i].get("TS_ZT")=="未处理"){
													Ext.Msg.alert("提示", "该记录还未处理");
													return;

												}else{
													 Ext.Msg.wait('发布中，请稍后...', '提示');
													  Ext.getCmp("TS_ZT").setValue("已发布");
													 var extAjax = Ext.Ajax;
													 extAjax.request({
														 url:"${webctx}/ggts_updateDcfsGgtsJbxx_tsfb.action",
														 method: 'POST',
														 params:{'dcfsGgtsJbxx.tszt': Ext.getCmp("TS_ZT").getValue(),'dcfsGgtsJbxx.tsbh':Ext.getCmp("ggts_grid").getSelectionModel().getSelections()[i].get("TS_BH")},
														 callback: function (object, bool, response) {
															Ext.Msg.hide();
															Ext.getCmp("ggts_grid").getStore().load({ params:{ start: 0, limit: 30} } );
														 },
														 failure: function (response) {
															Ext.Msg.alert("提示", "操作出现了异常！");
														 }

												 });
												}

											}


									}
								   });

							  }
							  else if (Ext.getCmp("ggts_grid").getSelectionModel().getCount() == 0) {
									Ext.Msg.alert("提示", "请最少选择一条记录");
							  }

					}

				}

			],
			listeners: {
				"rowdblclick":function(g,recordNum,e) {


					Ext.getCmp("ggts_Form").getForm().reset();
					Ext.getCmp("Win").setSize(800,350);
					 Ext.getCmp('Win').show();


					Ext.getCmp('Win').action='update';
					Ext.getCmp('Win').setTitle("投诉基本信息");
					 Ext.getCmp('Win').recordNum=recordNum;
					Ext.getCmp('Win').center();

				   if(Ext.getCmp('Win').changeValue!='-1'||Ext.getCmp("ggts_Form"))
					   {
						  Ext.getCmp('Win').setTitle("投诉基本信息");
						   Ext.getCmp("submit_btn").setText('保存');

						   Ext.getCmp("ggts_Form").getForm().loadRecord(Ext.getCmp("ggts_grid").getStore().getAt(recordNum));

							 // alert( Ext.getCmp("get_SB_BH").getValue())


							  Ext.getCmp("TS_BH").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_BH"));
							   Ext.getCmp("TS_SJ").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SJ"));


							  Ext.getCmp("TS_R").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_R"));
							  Ext.getCmp("TS_DD").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_DD"));
							  Ext.getCmp("TS_R_LXDH").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_R_LXDH"));
							  Ext.getCmp("TS_SB_SSQY").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SB_SSQY"));
							  //Ext.getCmp("TS_SB_LX").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SB_LX"));
							  Ext.getCmp("TS_SB_MC").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_SB_MC"));
							  Ext.getCmp("TS_QKMS").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_QKMS"));
							  Ext.getCmp("TS_BZ").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_BZ"));
							   Ext.getCmp("TS_ZT").setValue(Ext.getCmp("ggts_grid").getStore().getAt(Ext.getCmp('Win').recordNum).get("TS_ZT"));

					  }
					   if(!Ext.getCmp("ggts_Form"))
							{
								if(Ext.getCmp('Win').changeValue == '-1')
								{
									Ext.getCmp('Win').removeAll();
								}
								Ext.getCmp('Win').load({url:'${webctx}/ggts_getDcfsTsclJbxxListByCond.action',scripts:true,params:{loaditem:"add"}});
								Ext.getCmp('Win').changeValue = '1';
							}


				}
			}

		 }

	  ]

	});
	Ext.getCmp("ggts_grid").getStore().load();
});

</script>
</body>
</html>